﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.UI;
using System.ComponentModel;
using System.Collections;

namespace Kevin.Controls
{
    /*-----------------------------------------------------------------------------------------------------------
     * 查询条件参数类:偷懒了，直接从数据绑定中继承了，无非是根据控件ID和取值的属性获取控件的数据
     * 
     * 
     * 
     * 
     *----------------------------------------------------------------------------------------------------
     */
    /// <summary>
    /// 查询条件参数类
    /// </summary>
    [Serializable]
    [ToolboxItem(false)]
    [ToolboxData("<{0}:DataBindItem runat=\"server\" />")]
    public class QueryParameter:DataBindItem
    {
        public QueryParameter()
            : base()
        { }
    }

    /// <summary>
    /// 查询条件集合类
    /// </summary>
    public class QueryParameterCollection : CollectionBase
    {
        public void Add(QueryParameter item)
        {
            if (item != null)
                base.List.Add(item);
        }

        public QueryParameter this[int index]
        {
            get { return (QueryParameter)List[index]; }
            set { List[index] = value; }
        }

        public bool Contains(string DataPropertyName)
        {
            foreach (QueryParameter item in this)
            {
                if (item.DataPropertyName == DataPropertyName)
                    return true;
            }
            return false;
        }
    }
}
